using System.Web.Mvc;

namespace OTE.Web.Infrastructure.Helper
{
    public static class StaticFileUrlHelperExtension
    {
        private const string CssDir = "css";
        private const string ScriptDir = "js";
        private const string ImageDir = "image";

        public static string Css(this UrlHelper urlHelper, string fileName)
        {
            if (!fileName.EndsWith(".css"))
                fileName += ".css";

            return urlHelper.Content(string.Format("~/Content/{0}/{1}", CssDir, fileName));
        }

        public static string Script(this UrlHelper urlHelper, string fileName)
        {
            if (!fileName.EndsWith(".js"))
                fileName += ".js";

            return urlHelper.Content(string.Format("~/Content/{0}/{1}", ScriptDir, fileName));
        }

        public static string Image(this UrlHelper urlHelper, string fileName)
        {
            return urlHelper.Content(string.Format("~/Content/{0}/{1}", ImageDir, fileName));
        }
    }
}